$(document).ready(function(){
    
    /**************Parser definition*************/
    
    //Monney
    $.tablesorter.addParser({ 
        // set a unique id 
        id: 'monney', 
        is: function(s) { 
            // return false so this parser is not auto detected 
            return false; 
        }, 
        format: function(s) { 
            // format your data for normalization 
            var x = parseFloat(s.replace(/\s/g,"").replace(/,/,"."));
            return x; 
        }, 
        // set type, either numeric or text 
        type: 'numeric' 
    }); 
    
    
    //Custom date
    $.tablesorter.addParser({ 
        // set a unique id 
        id: 'customdate', 
        is: function(s) { 
            // return false so this parser is not auto detected 
            return false; 
        }, 
        format: function(s) { 
            var res = 0;
            var temp = s.split("/");
            res += parseInt(temp[2])*10000;
            res += parseInt(temp[1])*100;
            res += parseInt(temp[0]);
            return res; 
        }, 
        // set type, either numeric or text 
        type: 'numeric' 
    });
     
     
    /*****************Init sorter*********************/
    
    $("#myTable").tablesorter({ 
        headers: { 
            2: { sorter:'customdate' },
            3: { sorter:'customdate' }
        },
        sortList: [[0,1]]
    });
    
});